﻿using System;
using System.Data;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace HRMService
{
    [ServiceContract(Namespace = "http://HRMService")]
    public interface IPositionDetail
    {
        [OperationContract]
        PositionDetailInfo PositionDetail_GetInfoMaxDate(int EmployeeID);
        [OperationContract]
        DataSet PositionDetail_GetAll();

        [OperationContract]
        DataSet PositionDetail_GetEmployeeLater(int DepartmentID);

        [OperationContract]
        DataSet PositionDetail_GetNewSalary();

        [OperationContract]
        DataSet PositionDetail_GetForInsurance(DateTime _DateVal, int BranchID, int DepartmentID, string _KeyWord);

        [OperationContract]
        DataSet PositionDetail_GetOlderSalary();

        [OperationContract]
        DataSet PositionDetail_BaoHiem(int month, int year);

        [OperationContract]
        DataSet PositionDetail_DieuChinh(int month, int year);

        [OperationContract]
        PositionDetailInfo PositionDetail_GetInfo(int EmloyeeeID);

        [OperationContract]
        PositionDetailInfo PositionDetail_GetInfoWithPDID(int PDID);

        [OperationContract]
        DataSet PositionDetail_GetList(out int ItemCount, int currentPage, int pageSize);

        [OperationContract]
        int PositionDetail_Insert(PositionDetailInfo eInfo);

        [OperationContract]
        bool PositionDetail_Update(PositionDetailInfo eInfo);

        [OperationContract]
        DataSet PositionDetail_GetWithEmployee(int EmployeeID);

        [OperationContract]
        DataSet PositionDetail_GetBranchWithEmployee(int EmployeeID);

        [OperationContract]
        DataSet PositionDetail_GetWithDepartment(int DepartmentID);

        [OperationContract]
        DataSet PositionDetail_GetMaxID(int EmployeeID);

        [OperationContract]
        bool PositionDetail_UpdateStatusEmployee(int EmployeeID);

        [OperationContract]
        bool PositionDetail_UpdateEmployee(int EmployeeID);

        [OperationContract]
        bool PositionDetail_ActiveEmployee(int PDID, DateTime date);

        [OperationContract]
        bool PositionDetail_UpdateEmployeeLater(int EmployeeID, DateTime date);

        [OperationContract]
        bool PositionDetail_Delete(int PositionDetailID);

        [OperationContract]
        bool PositionDetail_CountEmployeeWithDept(int DepartmentID);
    }
    [DataContract(Namespace = "http://HRMService")]
    public class PositionDetailInfo
    {
        int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        int _EmployeeID;
        [DataMember]
        public int EmployeeID
        {
            get { return _EmployeeID; }
            set { _EmployeeID = value; }
        }
        DateTime _BeginDate;
        [DataMember]
        public DateTime BeginDate
        {
            get { return _BeginDate; }
            set { _BeginDate = value; }
        }
        DateTime _EndDate;
        [DataMember]
        public DateTime EndDate
        {
            get { return _EndDate; }
            set { _EndDate = value; }
        }
        int _PositionID;
        [DataMember]
        public int PositionID
        {
            get { return _PositionID; }
            set { _PositionID = value; }
        }
        int _DepartmentID;
        [DataMember]
        public int DepartmentID
        {
            get { return _DepartmentID; }
            set { _DepartmentID = value; }
        }

        int _GradeID;
        [DataMember]
        public int GradeID
        {
            get { return _GradeID; }
            set { _GradeID = value; }
        }

        bool _IsActive;
        [DataMember]
        public bool IsActive
        {
            get { return _IsActive; }
            set { _IsActive = value; }
        }

        string _Description;
        [DataMember]
        public string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }

        int _LevelID;
        [DataMember]
        public int LevelID
        {
            get { return _LevelID; }
            set { _LevelID = value; }
        }

        decimal _MinSalary;
        [DataMember]
        public decimal MinSalary
        {
            get { return _MinSalary; }
            set { _MinSalary = value; }
        }

        //
        decimal _BasicFactor;
        [DataMember]
        public decimal BasicFactor
        {
            get { return _BasicFactor; }
            set { _BasicFactor = value; }
        }

        decimal _BasicSalary;
        [DataMember]
        public decimal BasicSalary
        {
            get { return _BasicSalary; }
            set { _BasicSalary = value; }
        }

        decimal _PositionFactor;
        [DataMember]
        public decimal PositionFactor
        {
            get { return _PositionFactor; }
            set { _PositionFactor = value; }
        }

        decimal _PositionAllowance;
        [DataMember]
        public decimal PositionAllowance
        {
            get { return _PositionAllowance; }
            set { _PositionAllowance = value; }
        }

        decimal _OverFactor;
        [DataMember]
        public decimal OverFactor
        {
            get { return _OverFactor; }
            set { _OverFactor = value; }
        }

        decimal _OverAllowance;
        [DataMember]
        public decimal OverAllowance
        {
            get { return _OverAllowance; }
            set { _OverAllowance = value; }
        }

        decimal _JobFactor;
        [DataMember]
        public decimal JobFactor
        {
            get { return _JobFactor; }
            set { _JobFactor = value; }
        }


        decimal _JobAllowance;
        [DataMember]
        public decimal JobAllowance
        {
            get { return _JobAllowance; }
            set { _JobAllowance = value; }
        }

        decimal _AreaFactor;
        [DataMember]
        public decimal AreaFactor
        {
            get { return _AreaFactor; }
            set { _AreaFactor = value; }
        }

        decimal _AreaAllowance;
        [DataMember]
        public decimal AreaAllowance
        {
            get { return _AreaAllowance; }
            set { _AreaAllowance = value; }
        }

        decimal _TelephoneAllowance;
        [DataMember]
        public decimal TelephoneAllowance
        {
            get { return _TelephoneAllowance; }
            set { _TelephoneAllowance = value; }
        }

        decimal _LunchAllowance;
        [DataMember]
        public decimal LunchAllowance
        {
            get { return _LunchAllowance; }
            set { _LunchAllowance = value; }
        }


        decimal _OtherAllowance;
        [DataMember]
        public decimal OtherAllowance
        {
            get { return _OtherAllowance; }
            set { _OtherAllowance = value; }
        }

        //
        decimal _TotalSalary;
        [DataMember]
        public decimal TotalSalary
        {
            get { return _TotalSalary; }
            set { _TotalSalary = value; }
        }

        string _Job;
        [DataMember]
        public string Job
        {
            get { return _Job; }
            set { _Job = value; }
        }
        
        
        decimal _OtherFactor;
        [DataMember]
        public decimal OtherFactor
        {
            get { return _OtherFactor; }
            set { _OtherFactor = value; }
        }
        
        
        
        bool _LaterInsurance;
        [DataMember]
        public bool LaterInsurance
        {
            get { return _LaterInsurance; }
            set { _LaterInsurance = value; }
        }

        DateTime _DatePositionEnd;
        [DataMember]
        public DateTime DatePositionEnd
        {
            get { return _DatePositionEnd; }
            set { _DatePositionEnd = value; }
        }

        DateTime _DatePositionBegin;
        [DataMember]
        public DateTime DatePositionBegin
        {
            get { return _DatePositionBegin; }
            set { _DatePositionBegin = value; }
        }
        DateTime _DateSalary;
        [DataMember]
        public DateTime DateSalary
        {
            get { return _DateSalary; }
            set { _DateSalary = value; }
        }
        string _Type;
        [DataMember]
        public string Type
        {
            get { return _Type; }
            set { _Type = value; }
        }
    }
}
